<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		.red{
			background:red;
		}
		.blue{
			background-color: blue;
		}
	</style>
</head>
<body ng-app="myApp">
<div class="{{color='red'}}" my-btn></div>
<div class="{{color='blue'}}" my-btn></div>

	<script id="tmp" type="text/ng-template">
		<ul>
			<li>这是通过templateUrl模板添加的内容</li>
		</ul>
	</script>
	<script src="angular.js"></script>
	<script>
		var app = angular.module("myApp",[]);
		app.directive("myBtn",[function(){
			return {
				templateUrl:'tmp',
				scope:{
					color:'@',
				}
			};
		}]);
	</script>
</body>
</html>
